<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>
    <style>
        .html{
            width: 200px;
            height: 200px;
            background-color: cornflowerblue;
        }
        .css{
            width: 200px;
            height: 200px;
            background-color: crimson;
        }
    </style>
</head>
<body>
    <ul>
        <li>html</li>
        <li>css</li>
    </ul>
    <div class="html">html</div>
    <div class="css">css</div>
    <script>
        $("li").click(function(){
            $("div").css({display:"none"});
            var num = $(this).index();
            console.log(num);
            $("div").eq(num).css({display:"block"});
        })
    </script>
</body>
</html>